<template>
  <div>
    <el-input
      v-bind="$props"
      v-model="currentValue"
      @change="changeVal"
      class="input-with-select"
    >
    <slot slot="append"></slot>
    </el-input>
  </div>
</template>

<script>
import { Input } from "element-ui";
export default {
  components: {  },
  name: "InputDown",
  props: {
    ...Input,
    temp:{
      type:String,
      default:"1"
    },
    value: {
      type: String,
      default: "",
    },
    placeholder: {
      type: String,
      default: "",
    },
    selectCallback: {
      type: Function,
      default: () => {
        return Function;
      },
    },
  },
  data() {
    return {
      select: "1",
    };
  },
  computed: {
    currentValue: {
      get: function () {
        return this.value;
      },
      set: function (newValue) {
        this.$emit("input", newValue); // 通过 input 事件更新 model
      },
    },
  },
  methods: {
    changeVal(val, lr) {
      this.$emit("change", val, lr); // 事件传值
    },
    selectChange() {
      this.selectCallback(this.select);
    },
  },
};
</script>

<style>

</style>
